<template>
  <div class="header-title">
    <span class="title-name">{{ dialogTitle }}</span>
    <div v-if="showFullIcon">
      <icon-fullscreen v-if="!fullScreen" class="header-full-screen" @click="emit('is-fullScreen', !props.fullScreen)" />
      <icon-fullscreen-exit v-else class="header-full-screen" @click="emit('is-fullScreen', !props.fullScreen)" />
    </div>
  </div>
</template>

<script lang="ts" setup name="DialogHeader">
import { propTypes } from "@/utils/propTypes";

const props = defineProps({
  /**
   * 标题
   */
  dialogTitle: propTypes.string.def(""),
  /**
   * 是否全屏 默认假
   */
  fullScreen: propTypes.bool.def(false),
  /**
   * 是否显示放大缩小图标
   */
  showFullIcon: propTypes.bool.def(false)
});
const emit = defineEmits(["is-fullScreen", "bar"]);
</script>

<style lang="less" scoped>
.header-title {
  display: flex;
  justify-content: center;
  width: 100%;
  font-size: var(--font-size-body-3);
  font-weight: var(--font-weight-600);
}

.title-name {
  font-weight: 600;
  color: #ffffff;
}

.header-full-screen {
  right: 20px;
  margin-right: 20px;
  color: #fff;
  cursor: pointer;
  position: absolute;
  margin-top: 5px;
}
</style>
